#include<iostream>
using namespace std;
const int N = 1e3 + 10;
int a[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> a[i];
	int ans = -1e9;
	for (int i = 2; i <= n; i++)ans = max(ans, abs(a[i] - a[i - 1]));
	cout << ans << endl;
	return 0;
}